<template>
  <div class="container contract-review mb70">
    <p class="bread">
      <a href="#/index/law-order-manage" class="font-s-18">法律服务订单-业务管理部</a>
    </p>
    <div class="bg-c-fff box-border">
      <h3 class="tm-title">法律服务订单详情</h3>
      <step :stepData="stepData" :stepNum="stepNum"></step>
    </div>
    <div class="content bg-c-fff">
      <h3 class="tc">交易监控流程图</h3>
      <div class="progress-box rel">
        <company-name-container :companyNames="companyNames"></company-name-container>
        <div class="line" :class="{center: companyNames.length===2}" :style="{height: (events.length+0.5)*90+60+'px'}">
          <div class="arrow"></div>
        </div>
        <event-item v-for="(item,index) in events" :key="index" :state="item.state" :totalSides="companyNames.length" :side="item.side" :content="item.content" :files="item.files"></event-item>
      </div>
      <p class="tc">交易监控结束</p>
    </div>
    <a href="#/busines-law-complete">下一步</a>
  </div>
</template>
<script type="text/javascript">
import Step from '../components/Step'
import CompanyNameContainer from '../components/CompanyNameContainer'
import EventItem from '../components/EventItem'
export default {
  components: {
    Step,
    CompanyNameContainer,
    EventItem
  },
  data() {
    return {
      stepNum: 2,
      stepData: [{
        name: '法律服务通知单'
      }, {
        name: '绘制流程图'
      }, {
        name: '法律服务监控'
      }, {
        name: '服务完成'
      }],
      companyNames: [{
        name: '甲方有限公司'
      }, {
        name: '乙方有限公司'
      }],
      events: [{
        side: 0,
        files: [],
        content: '12312323123asdfasdf',
        state: 'done'
      }, {
        side: 1,
        files: [1],
        content: '12312323123asdfasdf',
        state: 'doing'
      }, {
        side: 0,
        files: [1, 2],
        content: '12312323123asdfasdf',
        state: 'todo'
      }, {
        side: 1,
        files: [1, 2, 3],
        content: '12312323123asdfasdf',
        state: 'todo'
      }, {
        side: 1,
        files: [1, 2, 3],
        content: '12312323123asdfasdf',
        state: 'todo'
      }]
    }
  }
}

</script>
<style type="text/css" scoped>
.content {
  padding-bottom: 30px;
  margin-top: 20px;
}

.content h3 {
  line-height: 40px;
  border-bottom: 1px solid #ddd;
}

.line {
  position: absolute;
  width: 2px;
  top: 0;
  left: 65px;
  margin-top: 10px;
  background-color: #cfcfcf;
}

.line.center {
  left: 50%;
}

.line .arrow {
  position: absolute;
  bottom: -10px;
  left: -7px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #cfcfcf;
}

.content p {
  margin-top: 50px;
}

</style>
